import request from "@/utils/request";


/**
 * 加载挂号列表[待就诊]
 * @param scheudlingType
 * @returns {*}
 */
export function queryToBeSeenRegistration(scheudlingType) {
	return request({
		url: `/seeADoctor/NewCare/queryToBeSeenRegistration/${scheudlingType}`,
	})
}

/**
 * 加载挂号列表[就诊中]
 * @param scheudlingType
 * @returns {*}
 */
export function queryVisitingRegistration(scheudlingType) {
	return request({
		url: `/seeADoctor/NewCare/queryVisitingRegistration/${scheudlingType}`,
	})
}

/**
 * 加载挂号列表[就诊完成]
 * @param scheudlingType
 * @returns {*}
 */
export function queryVisitCompletedRegistration(scheudlingType) {
	return request({
		url: `/seeADoctor/NewCare/queryVisitCompletedRegistration/${scheudlingType}`,
	})
}

/**
 * 接诊
 * @param regId
 * @returns {*}
 */
export function receivePatient(regId) {
	return request({
		url: `/seeADoctor/NewCare/receivePatient/${regId}`,
		method: 'get'
	})
}

/**
 * 根据患者ID查询患者信息 患者档案信息  历史病例
 * @param patientId 患者id
 * @returns {*}
 */
export function getPatientAllMessageByPatientId(patientId) {
	return request({
		url: `/seeADoctor/NewCare/getPatientAllMessageByPatientId/${patientId}`,
	})
}

// 根据挂号ID查询病历信息
export function getCareHistoryByRegId(regId) {
	return request({
		url: `/seeADoctor/NewCare/getCareHistoryByRegId/${regId}`,
		method: 'get'
	})
}

/**
 *
 * 保存病历的接口
 * @param data
 * @returns {*}
 */
export function saveCareHistory(data) {
	return request({
		url: '/seeADoctor/NewCare/saveCareHistory',
		method: 'post',
		data: data
	})
}

// 根据病例ID查询处方列表及详情
export function queryCareOrdersByChId(chId) {
	return request({
		url: `/seeADoctor/NewCare/queryCareOrdersByChId/${chId}`,
		method: 'get'
	})
}

// 保存处方及详情信息
export function saveCareOrderItem(data) {
	return request({
		url: '/seeADoctor/NewCare/saveCareOrderItem',
		method: 'post',
		data
	})
}

/**
 * 查询检测处方的项目
 * @returns {*}
 */
export function selectCheckItemList() {
	return request({
		url: '/accountant/InspectionItemStatistics/selectSysCheckItem',
		method: 'post',
	})
}
export function selectCheckItemListByKey(data) {
	return request({
		url: '/accountant/InspectionItemStatistics/selectSysCheckItemByKeyWords',
		method: 'post',
		data: data,
	})
}

// 根据挂号单号完成就诊
export function visitComplete(regId) {
	return request({
		url: `/seeADoctor/NewCare/visitComplete/${regId}`,
		method: 'get'
	})
}

// 根据处方详情ID删除处方详情【只能删除未支付的】
export function deleteCareOrderItemById(itemId) {
	return request({
		url: `/seeADoctor/NewCare/deleteCareOrderItemById/${itemId}`,
		method: 'delete'
	})
}

